import React, { Component } from 'react'
import { NavLink } from 'react-router-dom';

export default class List extends Component {
    constructor() {
        super();
        this.state = {
            list: [
                {name: '单身情歌', id:1},
                {name: '分手快乐', id:2},
                {name: '不要再来伤害我', id:3},
                {name: '我和我的祖国', id:4},
            ]
        }
    }
  render() {
    return (
      <>
        {
            this.state.list.map(item => {
                return (
                    <div key={item.id}>
                        <NavLink to={'/detail/'+item.id}>{item.name}</NavLink>
                    </div>
                )
            })
        }
      </>
    )
  }
}
